package cardwall.shared;

/**
 * @author $LastChangedBy: vogensen $
 * @version $Revision: 2 $
 */
public class GTask implements Task {
    private String name;
    private String description;
    private int id;
    private int top;
    private int left;

    public GTask() {
    }

    public GTask(Task task) {
        this.id = task.getId();
        this.name = task.getName();
        this.description = task.getDescription();
        this.left = task.getLeft();
        this.top = task.getTop();
    }

    public String getName() {
        return name;
    }

    public Task setName(String value) {
        name = value;
        return this;
    }

    public String getDescription() {
        return description;
    }

    public Task setDescription(String value) {
        description = value;
        return this;
    }

    public int getId() {
        return id;
    }

    public Task setId(int value) {
        id = value;
        return this;
    }

    public int getLeft() {
        return left;
    }

    public Task setLeft(int value) {
        left = value;
        return this;
    }

    public int getTop() {
        return top;
    }

    public Task setTop(int value) {
        top = value;
        return this;
    }

    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        GTask task = (GTask) o;

        if (id != task.id) return false;
        if (left != task.left) return false;
        if (top != task.top) return false;
        if (description != null ? !description.equals(task.description) : task.description != null) return false;
        if (name != null ? !name.equals(task.name) : task.name != null) return false;

        return true;
    }

    public int hashCode() {
        int result;
        result = (name != null ? name.hashCode() : 0);
        result = 31 * result + (description != null ? description.hashCode() : 0);
        result = 31 * result + id;
        result = 31 * result + top;
        result = 31 * result + left;
        return result;
    }
}
